package main


func maxhuiwenchuan(str string) string {
	start,end := 0,0

	for k,_ := range str {
		left,right := handhuiwenchuan(str,k,k)
		if (right - left) > (end-start) {
			start,end = left,right
		}
		left,right = handhuiwenchuan(str,k,k+1)
		if (right - left) > (end-start) {
			start,end = left,right
		}
	}
	return str[start:end+1]
}

func handhuiwenchuan(str string,i,j int) (int,int) {
	for ;i>=0&&j<len(str)&&str[i]==str[j];i,j=i-1,j+1{

	}

	return i+1,j-1
}
